﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Manage_BargainListPrice2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        CurrentAccount.CheckSessionTimeOut(this);
        if (!IsPostBack)
        {
            Bind();
        }
    }
    protected void pager1_PageChanging(object sender, HZ.Web.PageChaningEventArgs e)
    {
        Bind();

    }
    private void Bind()
    {
        int totalrecord;
        string Append="";
        if (!string.IsNullOrEmpty(txtUserName.Text)) 
        {
            Append = string.Format(" and UserName like '%{0}%'",txtUserName.Text);
        }
        DataTable dt = BLL_Factory.IBLL_Company.GetBarginListPrice2(Append, pager1.CurrentPage, pager1.PageSize, out totalrecord);
        pager1.RecordCount = totalrecord;
        gv1.DataSource = dt;
        gv1.DataBind();
    }
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        pager1.CurrentPage = 1;
        Bind();
    }

}
